package com.smart.oauth2.service;

import com.smart.oauth2.entity.OauthClientDetails;
import com.smart.oauth2.mapper.OauthClientDetailsMapper;
import org.springframework.security.oauth2.provider.ClientDetails;
import org.springframework.security.oauth2.provider.ClientDetailsService;
import org.springframework.security.oauth2.provider.ClientRegistrationException;
import org.springframework.stereotype.Service;


import javax.annotation.Resource;

@Service
public class OauthClientDetailsService implements ClientDetailsService {
    @Resource
    OauthClientDetailsMapper mapper;

    @Override
    public ClientDetails loadClientByClientId(String clientId) throws ClientRegistrationException {
        return mapper.selectByPrimaryKey(clientId);
    }
}
